package com.lingnan.entity;

import lombok.Data;

@Data
public class WebSocketMessage {
    private String type; // 消息类型
    private Long userId; // 用户ID
    private Object data; // 消息数据
    private Long timestamp;
    
    public static WebSocketMessage notification(Long userId, NotificationDTO notification) {
        WebSocketMessage message = new WebSocketMessage();
        message.setType("notification");
        message.setUserId(userId);
        message.setData(notification);
        message.setTimestamp(System.currentTimeMillis());
        return message;
    }
}